Fluent Assertions Documentation
FluentAssertions Assembly / FluentAssertions.Specialized Namespace / JsonNodeAssertions<T> Class / NotBeEquivalentTo Method / NotBeEquivalentTo<TExpectation>(TExpectation,String,Object[]) Method
The expected object graph, such as an anonymous type.
A formatted phrase as is supported by System.String.Format(System.String,System.Object[]) explaining why the assertion is needed. If the phrase does not start with the word because, it is prepended automatically.
Zero or more objects to format using the placeholders in because.
In This Topic
    NotBeEquivalentTo<TExpectation>(TExpectation,String,Object[]) Method
    In This Topic
    Asserts a JSON node is NOT equivalent to a given C# object graph.
    Syntax

    Parameters

    unexpected
    The expected object graph, such as an anonymous type.
    because
    A formatted phrase as is supported by System.String.Format(System.String,System.Object[]) explaining why the assertion is needed. If the phrase does not start with the word because, it is prepended automatically.
    becauseArgs
    Zero or more objects to format using the placeholders in because.

    Type Parameters

    TExpectation
    Exceptions
    ExceptionDescription
    because
    Permissions
    PermissionDescription
    because
    Remarks
    Traverses the properties of the unexpected object graph, which can contain nested objects and collections, and compares them to the properties the JSON node. Two properties are considered equal when their names and values match. The comparison is recursive, so nested properties and collections are compared in the same way. The comparison is driven by the expectation, so if the JSON node contains extra properties, they are ignored. If the JSON node has a property that contains an ISO 8601 date (local or UTC), it can be compared to a System.DateTime property of the expectation. The default global configuration can be modified through FluentAssertions.Configuration.GlobalConfiguration.Equivalency.
    Example
    because
    Supported Frameworks
    because
    See Also